function ts2str(ts) {
    let date = new Date(ts)
    let year = date.getFullYear()
    let month = date.getMonth()
    month = month < 9 ? `0${month+1}` : month+1
    let day = date.getDate()
    day = day < 10 ? `0${day}` : day
    console.log(date)
    return `${year}-${month}-${day} `
}

export default (context, inject) => {
    let repositories = {
        ts2str: ts2str,
    }

    inject('tool', repositories)
}